﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ComeSeeThis_MVC2.Models.Tire>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.RenderPartial("SubMenu"); %>
    <h2>
        Index</h2>
    <table>
        <tr>
            <th>
                Company
            </th>
            <th>
                Tire Name
            </th>
            <th>
                Part Number
            </th>
            <th>
                Tire Diameter
            </th>
            <th>
                Vehicle Types
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%: item.Company.CompanyName %>
            </td>
            <td>
                <%: Html.ActionLink(item.TireName, "Details", new { id=item.TireId}) %>
            </td>
            <td>
                <%: item.PartNumber %>
            </td>
            <td>
                <%: String.Format("{0:F}", item.TireDiameter) %>
            </td>
            <td>
                <% foreach (var vehicleType in item.VehicleTypes)
                   {%>
                1/<%: vehicleType.Scale %>
                <%: vehicleType.VehicleTypeName %>
                <br />
                <%} %>
            </td>
        </tr>
        <% } %>
    </table>
    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="BodyTagContent" runat="server">
</asp:Content>
